import threading


class MyThread(threading.Thread):
    def run(self):
        print('thread' + str(self.getName()))


if __name__ == '__main__':
    tl = list()
    for i in range(10000):
        mt = MyThread()
        mt.setName(i)
        tl.append(mt)

    for mt in tl:
        mt.start()


